using System.Linq;
using System.Reflection;
using jSLCore.Client.Presentation.BaseControl;

namespace jSLApp.Client.Workflow
{
    public static class Helper
    {
        public static ShowCase[] GetShowCases()
        {
            var typesInAssemblies = Assembly.GetExecutingAssembly().GetTypes();

            return typesInAssemblies
                .Where(t => t.IsSubclassOf(typeof(BaseControl)))
                .Where(t => t.GetCustomAttributes(typeof(ShowCaseAttribute), false).Length != 0)
                .Select(t => new ShowCase(t))
                .ToArray();
        }
    }
}